{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Most examples work across multiple plotting backends, this example is also available for:\n",
    "\n",
    "* [Matplotlib - iris_grouped_grid](../matplotlib/iris_grouped_grid.ipynb)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import holoviews as hv\n",
    "from holoviews import opts\n",
    "hv.extension('bokeh')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Declaring data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from bokeh.sampledata.iris import flowers\n",
    "from holoviews.operation import gridmatrix\n",
    "\n",
    "iris_ds = hv.Dataset(flowers).groupby('species').overlay()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Plot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "density_grid = gridmatrix(iris_ds, diagonal_type=hv.Distribution, chart_type=hv.Bivariate)\n",
    "point_grid = gridmatrix(iris_ds, chart_type=hv.Points)\n",
    "\n",
    "(density_grid * point_grid).opts(\n",
    "    opts.Bivariate(bandwidth=0.5, cmap=hv.Cycle(values=['Blues', 'Reds', 'Oranges'])),\n",
    "    opts.Points(size=2, alpha=0.5),\n",
    "    opts.NdOverlay(batched=False))"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
